<?php 
namespace app\index\validate;
use think\Validate;
class Vip extends Validate{
	protected $regex = [
		// 'zname' => '\w{2,6}',
		'istel'=>'1[3578]\d{9}',
	];

	protected $rule = [
		// 'uname'=>'require|regex:zname',
		'user'=>'require',
		'nickname'=>'require|unique:vip,nickname',
		'tel'=>'require|istel|unique:vip,tel',
		'pwd'=>'require|length:6,16|confirm',
		'city'=>'require',
		'area'=>'require',
		'code'=>'require|captcha'
	];

	protected $message = [
		//'uname.require'=>'姓名不能为空',
		'user.require'=>'请输入用户名/手机号',
		'pwd.require'=>'请输入密码',
		'pwd.length'=>'密码为6-16位任意字符组合',
		'pwd.confirm'=>'两次密码输入不一致',
		'nickname.require'=>'用户名不能为空',
		'nickname.unique'=>'用户名已存在',
		'tel.require'=>'手机号不能为空',
		'tel.istel'=>'手机号格式错误',
		'tel.unique'=>'手机号已被注册',
		'city.require'=>'请选择城市',
		'area.require'=>'请选择区域',
		'code.require'=>'请输入验证码',
		'code.captcha'=>'验证码错误',
	];

	protected $scene = [
		// 'add'=>'uname.email,pwd',
		'login'=>'user,pwd.require',
		'regist'=>'nickname,tel,pwd,area,city,code',
		'edit'=>'area'
	];
}

 ?>